import maxRow from '@/plugin/maxRow';
import maxPanel from '@/plugin/maxPanel';
import maxButton from '@/plugin/maxButton';
import maxInput from "@/components/base/maxInput";
import maxForm from '@/plugin/maxForm';
import maxModal from '@/plugin/maxModal';
import maxTree from '@/plugin/maxTree';
import maxTable from '@/plugin/maxTable';
import maxTabs from '@/plugin/maxTabs';

const components = [
    maxRow,
    maxPanel,
    maxButton,
    maxInput,
    maxForm,
    maxModal,
    maxTree,
    maxTable,
    maxTabs,
]

const install = function (Vue) {
    if (install.installed) return
    components.map(component => {
        Vue.component(component.name, component)
    })
    if (typeof window !== 'undefined' && window.Vue) {
        install(window.Vue)
    }
}

export default {
    install,
    maxRow,
    maxPanel,
    maxButton,
    maxInput,
    maxForm,
    maxModal,
    maxTree,
    maxTable,
    maxTabs,
}